﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BaoCaoToChuc.aspx.cs" Inherits="Viewer.BaoCao.BaoCaoToChuc" %>

<%@ Register Src="~/BaoCao/UserControls/UcTinhHinhNghiHuu.ascx" TagName="UcTinhHinhNghiHuu"
    TagPrefix="uc" %>
<%@ Register Src="~/BaoCao/UserControls/UcTinhHinhTangLuong.ascx" TagName="UcTinhHinhTangLuong"
    TagPrefix="uc" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <link href="../resources/css/main.css" rel="stylesheet" type="text/css" />
    <title>Untitled Page</title>
    <ext:XScript ID="XScipt1" runat="server">
    <script type="text/javascript">

        var filterTree = function(el, e) {
            var tree = TreePanel,
                text = this.getRawValue();

            tree.clearFilter();

            if (Ext.isEmpty(text, false)) {
                return;
            }

            if (e.getKey() === Ext.EventObject.ESC) {
                clearFilter();
            } else {
                var re = new RegExp(".*" + text + ".*", "i");

                tree.filterBy(function(node) {
                    return re.test(node.text);
                });
            }
        };
        var clearFilter = function() {
            var field = TriggerField1,
                tree = TreePanel;

            field.setValue("");
            tree.clearFilter();
            tree.getRootNode().collapseChildNodes(true);
            tree.getRootNode().ensureVisible();
        };

        var refreshTree = function(tree, result) {
            var nodes = eval(result);
            if (nodes.length > 0) {
                tree.initChildren(nodes);
            }
            else {
                tree.getRootNode().removeChildren();
            }
        }

        var TreePanel_Click = function(node) {
            MenuPanel1.enable();
            __currentNode.setValue(node.id);

        };
    </script>
    </ext:XScript>
</head>
<body>
    <form id="form1" runat="server">
    <ext:ResourceManager Locale="vi" ID="ResourceManager1" runat="server" />
    <ext:Hidden ID="hdIdCha" runat="server">
    </ext:Hidden>
    <ext:Hidden ID="hdIdDelete" runat="server">
    </ext:Hidden>
    <div>
        <ext:Hidden ID="__currentNode" runat="server">
        </ext:Hidden>
        <ext:Viewport ID="Viewport1" runat="server">
            <Items>
                <ext:BorderLayout ID="BorderLayout1" runat="server">
                    <Center>
                        <ext:Panel ID="pnl" runat="server" MonitorResize="true" Layout="Fit" >
                            <Items>
                                <ext:TreePanel ID="TreePanel" runat="server" Width="200" Icon="ChartOrganisation"
                                    AutoScroll="true">
                                    <Listeners>
                                        <Click Handler="TreePanel_Click(node);" />
                                    </Listeners>
                                    <TopBar>
                                        <ext:Toolbar ID="Toolbar1" runat="server">
                                            <Items>
                                                <ext:ToolbarTextItem ID="ToolbarTextItem1" runat="server" Text="Tìm kiếm:" />
                                                <ext:ToolbarSpacer />
                                                <ext:TriggerField ID="TriggerField1" runat="server" EnableKeyEvents="true">
                                                    <Triggers>
                                                        <ext:FieldTrigger Icon="Clear" />
                                                    </Triggers>
                                                    <Listeners>
                                                        <KeyUp Fn="filterTree" Buffer="250" />
                                                        <TriggerClick Handler="clearFilter();" />
                                                    </Listeners>
                                                </ext:TriggerField>
                                            </Items>
                                        </ext:Toolbar>
                                    </TopBar>
                                </ext:TreePanel>
                            </Items>
                        </ext:Panel>
                    </Center>
                    <East>
                        <ext:Panel ID="Panel" runat="server" Title="Báo cáo tổ chức" Width="250">
                            <Items>
                                <ext:MenuPanel ID="MenuPanel1" runat="server" Disabled="true">
                                    <Menu ID="Menu3" runat="server">
                                        <Items>
                                            <ext:MenuItem   ID="MenuItem1" runat="server"
                                                Text="Báo cáo thống kê nhân sự theo mẫu" Icon="CalendarViewMonth">
                                                <DirectEvents >
                                                    <Click OnEvent="Menu_Report" IsUpload="true" >
                                                        <ExtraParams>
                                                            <ext:Parameter Name="ReportType" Value="Thang" Mode="Value"></ext:Parameter>
                                                        </ExtraParams>
                                                    </Click>
                                                </DirectEvents>
                                                <Listeners>
                                                </Listeners>
                                            </ext:MenuItem>
                                            <%--<ext:MenuSeparator />
                                            <ext:MenuItem ID="MenuItem2" runat="server" Text="Báo cáo thống kê nhân sự theo quý"
                                                Icon="CalendarViewDay">
                                                <Listeners>
                                                    <%--<Click Handler=" #{__ReportType}.setValue('QuaTrinhCongTacCaNhan');  #{GridPanel1}.submitData(false);" />--%>
                                            <%--    </Listeners>
                                            </ext:MenuItem>
                                            <ext:MenuSeparator />
                                            <ext:MenuItem ID="MenuItem4" runat="server" Text="Báo cáo thống kê nhân sự theo năm"
                                                Icon="CalendarViewWeek">
                                                <Listeners>--%>
                                                    <%--<Click Handler="#{__ReportType}.setValue('QuaTrinhNangBac');  #{GridPanel1}.submitData(false);" />--%>
                                            <%--    </Listeners>
                                            </ext:MenuItem>--%>
                                            <ext:MenuSeparator />
                                            <ext:MenuItem ID="MenuItem3" runat="server" Text="Tình hình sắp nghỉ hưu" Icon="CalendarViewWeek">
                                                <Listeners>
                                                    <Click Handler="#{DirectMethods}.ShowPopUpNghiHuu(#{TreePanel}.getSelectionModel().getSelectedNode().id);" />
                                                </Listeners>
                                            </ext:MenuItem>
                                                 <ext:MenuSeparator />
                                            <ext:MenuItem ID="MenuItem5" runat="server" Text="Tình hình sắp tăng lương" Icon="CalendarViewWeek">
                                                <Listeners>
                                                    <Click Handler="#{DirectMethods}.ShowPopUpTangLuong(#{TreePanel}.getSelectionModel().getSelectedNode().id);" />
                                                </Listeners>
                                            </ext:MenuItem>
                                        </Items>
                                    </Menu>
                                </ext:MenuPanel>
                            </Items>
                        </ext:Panel>
                    </East>
                </ext:BorderLayout>
            </Items>
        </ext:Viewport>
    </div>
    <uc:UcTinhHinhNghiHuu ID="UcTinhHinhNghiHuu" runat="server">
    </uc:UcTinhHinhNghiHuu>
    <uc:UcTinhHinhTangLuong ID="UcTinhHinhTangLuong" runat="server">
    </uc:UcTinhHinhTangLuong>
    </form>
</body>
</html>
